clear
capture log close
set more off
use Couples1960

keep statefip age age_m race_m hispan_m educd_m incwage_m agemarr agemarr_m marrno marrno_m hwage_m 


replace incwage_m=incwage_m*172.2/29.6
replace hwage_m=hwage_m*172.2/29.6
gen white_m=(race_m==1&hispan_m==0)
gen black_m=(race_m==2&hispan_m==0)
gen hisp_m=(hispan_m!=0)
gen nohs_m=(educd_m<60)
gen hs_m=(educd_m>=60& educd<100)
gen coll_m=(educd_m==100)
gen adv_m=(educd_m>100)

gen agediff=age_m-age
gen pos=(agediff>0)
gen agediffpos=agediff*pos
gen agediffneg=agediff*(1-pos)*(-1)
gen ap1=(agediffpos>=2&agediffpos<=4)
gen ap2=(agediffpos>=5&agediffpos<=7)
gen ap3=(agediffpos>=8)
gen an1=(agediffneg>=2&agediffneg<=4)
gen an2=(agediffneg>=5&agediffneg<=7)
gen an3=(agediffneg>=8)

tab statefip, gen(stf)

tab age_m, gen(hfe)
gen hagehs=age_m*hs_m
tab hagehs, gen(hhsfe)
gen hagecoll=age_m*coll_m
tab hagecoll, gen(hcollfe)
gen hageadv=age_m*adv_m
tab hageadv, gen(hadvfe)

keep if marrno_m==1
gen agem2=agemarr_m*agemarr_m
gen marr2=(marrno==2)

log using Tab3_men_1960_col3col4.log, replace

keep if hwage_m !=0
keep if hwage_m !=.
reg hwage_m ap1 ap2 ap3 an1 an2 an3 agemarr_m agem2 marr2 white_m black_m hisp_m stf* hfe* hhsfe* hcollfe* hadvfe*, robust
tobit incwage_m ap1 ap2 ap3 an1 an2 an3 agemarr_m agem2 marr2 white_m black_m hisp_m stf* hfe* hhsfe* hcollfe* hadvfe*, ll(0) robust


log close




